package com.bytedance.common.plugin.faces;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.bytedance.common.plugin.baseface.BaseProxy;
import com.bytedance.common.plugin.interfaces.alipay.IAliPay;
import com.bytedance.common.plugin.interfaces.location.ILocation;
import com.bytedance.common.plugin.interfaces.pushmanager.IMessageContext;
import com.bytedance.common.plugin.interfaces.pushmanager.IPushLifeCycleListener;
import com.bytedance.common.plugin.interfaces.pushmanager.ISsPushManager;
import com.bytedance.common.plugin.interfaces.pushmanager.ISsRedabadgeManager;
import com.bytedance.common.plugin.interfaces.videocache.IReportCallback;
import com.bytedance.common.plugin.interfaces.videocache.IVideoCache;
import com.bytedance.common.plugin.mop.MopAgent;
import com.bytedance.common.plugin.mop.TargetType;

import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class LiteProxy extends BaseProxy implements IAliPay, ILocation, IPushLifeCycleListener, ISsPushManager, ISsRedabadgeManager, IVideoCache {
    private static volatile LiteProxy sInstance;

    private LiteProxy() {

    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void applyRedbageCount(Context context, int arg7) {
        this.mopAction(new Class[]{Context.class, Integer.TYPE}, new Object[]{context, Integer.valueOf(arg7)});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void cancelPreDownload() {
        this.mopAction(null, new Object[0]);
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void clearCache() {
        this.mopAction(null, new Object[0]);
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public Map getHttpCommonParams() {
        HashMap v0_1 = null;
        Object v0 = this.mopFuncSingle(null, new Object[0]);
        if (!(v0 instanceof Map)) {
            v0_1 = new HashMap();
        }

        return v0_1;
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public long getLocTime(Context context) {
        Object v0 = this.mopFuncSingle(new Class[]{Context.class}, new Object[]{context});
        return v0 instanceof Long ? (Long) v0 : 0;
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public JSONObject getLocationData(Context arg5) {
        JSONObject result = null;
        Object v0 = this.mopFuncSingle(new Class[]{Context.class}, new Object[]{arg5});
        if (!(v0 instanceof JSONObject)) {

        } else {
            result = (JSONObject) v0;
        }

        return result;
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void handleAppLogUpdate(Context context, String arg8, Map arg9) {
        this.mopAction(new Class[]{Context.class, String.class, Map.class}, new Object[]{context, arg8, arg9});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void handleAppLogUpdate(Context context, Map arg8, boolean arg9) {
        this.mopAction(new Class[]{Context.class, Map.class, Boolean.TYPE}, new Object[]{context, arg8, Boolean.valueOf(arg9)});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void initDaemon(Context context) {
        Log.d("DaemonClient", "initDaemon() called with: context = [" + context + "]");
        this.mopAction(new Class[]{Context.class}, new Object[]{context});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void initPushOnApplication(Context context, IMessageContext messageContext) {
        this.mopAction(new Class[]{Context.class, IMessageContext.class}, new Object[]{context, messageContext});
    }

    public static LiteProxy inst() {
        if (LiteProxy.sInstance == null) {
            synchronized (LiteProxy.class) {
                if (LiteProxy.sInstance == null) {
                    LiteProxy.sInstance = new LiteProxy();
                }
            }
        }
        return LiteProxy.sInstance;
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public boolean isDataNew(Context context, long arg8) {
        Object obj = this.mopFuncSingle(new Class[]{Context.class, Long.TYPE}, new Object[]{context, Long.valueOf(arg8)});
        return (obj instanceof Boolean) ? (Boolean) obj : false;
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void onLogConfigUpdate(Context context) {
        this.mopAction(new Class[]{Context.class}, new Object[]{context});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void onNotifyDestroy() {
        this.mopAction(null, new Object[0]);
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void onNotifyServiceCreate(Context context) {
        this.mopAction(new Class[]{Context.class}, new Object[]{context});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void onNotifyServiceStart(Intent intent) {
        this.mopAction(new Class[]{Intent.class}, new Object[]{intent});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void onPause(Context context) {
        this.mopAction(new Class[]{Context.class}, new Object[]{context});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void onResume(Context context) {
        this.mopAction(new Class[]{Context.class}, new Object[]{context});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public String pay(Activity activity, String arg7) {
        Object obj = this.mopFuncSingle(new Class[]{Activity.class, String.class}, new Object[]{activity, arg7});
        if (obj instanceof String) {
            return (String) obj;
        }
        return "";

    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void preDownload(String arg6, String[] arg7) {
        this.mopAction(new Class[]{String.class, String[].class}, new Object[]{arg6, arg7});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void preLoad(int preloadingSize, String key, String[] urls) {
        this.mopAction(new Class[]{Integer.TYPE, String.class, String[].class}, new Object[]{Integer.valueOf(preloadingSize), key, urls});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public String proxyUrl(String arg6, String[] arg7) {
        String v0_1 = "";
        Object v0 = this.mopFuncSingle(new Class[]{String.class, String[].class}, new Object[]{arg6, arg7});
        if (!(v0 instanceof String)) {

        } else {
            v0_1 = (String) v0;
        }

        return v0_1;
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void registerAllThirdPush(Context context) {
        this.mopAction(new Class[]{Context.class}, new Object[]{context});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void registerSelfPush(Context context) {
        this.mopAction(new Class[]{Context.class}, new Object[]{context});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void setAlias(Context context, String arg8, int arg9) {
        this.mopAction(new Class[]{Context.class, String.class, Integer.TYPE}, new Object[]{context, arg8, Integer.valueOf(arg9)});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void startProxyServer(Context arg6, IReportCallback arg7) {
        this.mopAction(new Class[]{Context.class, IReportCallback.class}, new Object[]{arg6, arg7});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void trackPush(Context context, int arg8, Object arg9) {
        this.mopAction(new Class[]{Context.class, Integer.TYPE, Object.class}, new Object[]{context, Integer.valueOf(arg8), arg9});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void tryLocale(Context arg7, boolean arg8, boolean arg9) {
        this.mopAction(new Class[]{Context.class, Boolean.TYPE, Boolean.TYPE}, new Object[]{arg7, Boolean.valueOf(arg8), Boolean.valueOf(arg9)});
    }

    @MopAgent(packageName = "com.bytedance.common.plugin.lite", targetType = TargetType.Plugin)
    public void unRegisterAllThirdPush(Context context) {
        this.mopAction(new Class[]{Context.class}, new Object[]{context});
    }
}

